package com.gjw.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gjw.bean.Student;
import com.gjw.mapper.StudentMapper;
import com.gjw.service.impl.StudentImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
//extends ServiceImpl<StudentMapper,Student>
@Service
public class StudentService  implements StudentImpl<Student> {

    @Autowired
    StudentMapper studentMapper;

    @Override
    public List<Student> getStudent(Integer pageNum, Integer pageSize) {
        Page<Student> page = new Page<>(pageNum, pageSize);
        Page<Student> studentPage = studentMapper.selectPage(page, null);
        List<Student> list = studentPage.getRecords();
        return list;
    }

    @Override
    public Student selectById(String id) {
        return studentMapper.mySelectById(id);
    }
}
